// +build js

package jsgo

import "syscall/js"

type JsLocation struct {
	JsObject
}

func (l *JsLocation) AncestorOrigins() js.Value {
	return l.value.Get("ancestorOrigins")
}

func (l *JsLocation) Assign(url string) {
	l.value.Call("assign", url)
}

func (l *JsLocation) Hash() string {
	return l.Attr("hash")
}

func (l *JsLocation) SetHash(hash string) {
	l.SetAttr("hash", hash)
}

func (l *JsLocation) Host() string {
	return l.Attr("host")
}

func (l *JsLocation) SetHost(host string) {
	l.SetAttr("host", host)
}

func (l *JsLocation) Hostname() string {
	return l.Attr("hostname")
}

func (l *JsLocation) SetHostname(hostname string) {
	l.SetAttr("hostname", hostname)
}

func (l *JsLocation) Href() string {
	return l.Attr("href")
}

func (l *JsLocation) SetHref(href string) {
	l.SetAttr("href", href)
}

func (l *JsLocation) Origin() string {
	return l.Attr("origin")
}

func (l *JsLocation) SetOrigin(origin string) {
	l.SetAttr("origin", origin)
}

func (l *JsLocation) Pathname() string {
	return l.Attr("pathname")
}

func (l *JsLocation) SetPathname(pathname string) {
	l.SetAttr("pathname", pathname)
}

func (l *JsLocation) Port() string {
	return l.Attr("port")
}

func (l *JsLocation) SetPort(port string) {
	l.SetAttr("port", port)
}

func (l *JsLocation) Protocol() string {
	return l.Attr("protocol")
}

func (l *JsLocation) SetProtocol(protocol string) {
	l.SetAttr("protocol", protocol)
}

func (l *JsLocation) Search() string {
	return l.Attr("search")
}

func (l *JsLocation) SetSearch(search string) {
	l.SetAttr("search", search)
}

func (l *JsLocation) Reload() {
	l.value.Call("reload")
}

func (l *JsLocation) Replace(urlPath string) {
	l.value.Call("replace", urlPath)
}
